package com.wl.web.domain;

import org.springframework.stereotype.Component;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/** @author wl */
@Component
public class User {

  @Size(min = 5, max = 20, message = " 用户名长度应在 5-20 字符之间")
  @Pattern(regexp = "^[a-zA-Z0-9]+$", message = " 用户名只应包含字母和数字")
  private String username;

  @Size(min = 6, max = 20, message = " 密码长度应在 6-20 个字符之间")
  private String password;

  public User() {}

  public User(String username, String password) {
    this.username = username;
    this.password = password;
  }

  public String getUsername() {
    return username;
  }

  public void setUsername(String username) {
    this.username = username;
  }

  public String getPassword() {
    return password;
  }

  public void setPassword(String password) {
    this.password = password;
  }
}
